<template>
  <div>
    <mychart :option="option_y" id="Day" width="3.9rem" height="1.75rem"></mychart>
  </div>
</template>

<script>
import * as echarts from "echarts";
import mychart from "../module/mychart.vue";
export default {
  components: { mychart },
  props:['Dy'],
  data() {
    return {
      option_y:{},
    }
  },
  created() {
    this.drawbar()
  },  
  mounted() {
   
  },
  methods: {
    drawbar(){
      this.option_y =  {
        title: {
          text: "每天各时段发现频次",
          top: "-6",
          left: "center",
          textStyle: {
            color: "#fff",
            fontSize: ".14rem",
            fontWeight: 400,
            fontFamily: "PingFang",
          }
        },
        grid: {
          left: "0%",
          top: "20%",
          right: "7%",
          bottom: "0%",
          containLabel: true,
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        xAxis: {
          data: [
            "0点",
            "2点",
            "4点",
            "6点",
            "8点",
            "10点",
            "12点",
            "14点",
            "16点",
            "18点",
            "20点",
            "22点",
          ],
          type: "category",
          axisTick: {
            show: false,
            alignWithLabel: false,
          },
          axisLabel: {
            textStyle:{
              show: false,
              fontFamily: "PingFang",
              // color: '#5DCFF6',
              color: "rgba(255, 255, 255, 0.80)",
              fontSize: ".14rem",
            },
            rotate: "45",
            interval: 0,
          },
        },
        yAxis: {
          type: "value",
          splitLine: {
            show: false,
            lineStyle: {
              color: "rgba(255, 255, 255, 0.80)",
            },
          },
          axisLine: {
            show: true, //不显示坐标轴线
          },
          axisLabel: {
            textStyle:{
              fontFamily: "PingFang",
              // color: '#5DCFF6',
              color: "rgba(255, 255, 255, 0.80)",
              fontSize: ".14rem",
            }
          },
        },
        series: [
          {
            data:this.Dy,
            name: "",
            type: "line",
            symbol: "none",
            symbol: "circle",
            smooth: true,
            symbolSize: 10,
            lineStyle: {
              width: 1,
              type: "solid",
            },
            itemStyle: {
              borderWidth: 2,
              borderColor: "#fff",
              color: "#0879FF",
            },
            areaStyle: {
              color: "#fff",
            
                //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                color: new echarts.graphic.LinearGradient(
                  0,
                  0,
                  0,
                  1,
                  [
                    {
                      offset: 0,
                      // color: 'RGBA(184, 204, 241, 1)'
                      color: "#0879FF",
                    },
                    //   {
                    //     offset: 0.5,
                    //     // color: 'RGBA(184, 204, 241, 0.5)'
                    //     color: "#0879FF",
                    //   },
                    {
                      offset: 1,
                      color: "#0D152F",
                      // color: '#283D46'
                    },
                  ],
                  false
                ),
                shadowBlur: 0, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
              
            },
          },
        ],
      }
    }
  },
}
</script>
<style  scoped>
.aaa {
  width: 5rem;
  height: 5rem;
}
</style>
